package de.baumann.browser.activitys.explore

import android.content.Context
import android.content.Intent
import de.baumann.browser.R
import de.baumann.browser.adapter.ExploreMineTeamPowerRecordAdapter
import de.baumann.browser.api.net.vo.explore.OdinDestroyMineTeamBean
import de.baumann.browser.base.BaseOdinActivity
import de.baumann.browser.iview.explore.ITeamOdinDestroyRecordView
import de.baumann.browser.present.explore.TeamOdinDestroyPresenter
import kotlinx.android.synthetic.main.activity_mine_team.*
import kotlinx.android.synthetic.main.include_tool_bar.*

class MineTeamActivity : BaseOdinActivity<ITeamOdinDestroyRecordView, TeamOdinDestroyPresenter>(), ITeamOdinDestroyRecordView {
    companion object {
        fun startMineTeamActivity(context: Context) {
            context.startActivity(Intent(context, MineTeamActivity::class.java))
        }
    }

    override fun getTitleText(): String {
        return "我的团队"
    }

    lateinit var teamPowerRecordAdapter: ExploreMineTeamPowerRecordAdapter
    override fun getLayout(): Int {
        return R.layout.activity_mine_team
    }

    override fun initView() {
        initToolbar(commToolBar, commTitle)
        teamPowerRecordAdapter = ExploreMineTeamPowerRecordAdapter()
        rvTeam.adapter = teamPowerRecordAdapter
    }

    override fun initData() {
    }

    override fun createPresenter(): TeamOdinDestroyPresenter {
        return TeamOdinDestroyPresenter()
    }

    override fun createView(): ITeamOdinDestroyRecordView {
        return this
    }

    override fun getDestroy(list: List<OdinDestroyMineTeamBean>) {
        teamPowerRecordAdapter.setNewData(list)
    }
}